3.701 \(\int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx\)

Optimal. Leaf size=122 \[ -\frac {a^3 (A-5 i B)}{3 c^5 f (\tan (e+f x)+i)^3}+\frac {a^3 (2 B+i A)}{c^5 f (\tan (e+f x)+i)^4}+\frac {4 a^3 (A-i B)}{5 c^5 f (\tan (e+f x)+i)^5}-\frac {a^3 B}{2 c^5 f (\tan (e+f x)+i)^2} \]

[Out]

4/5*a^3*(A-I*B)/c^5/f/(tan(f*x+e)+I)^5+a^3*(I*A+2*B)/c^5/f/(tan(f*x+e)+I)^4-1/3*a^3*(A-5*I*B)/c^5/f/(tan(f*x+e
)+I)^3-1/2*a^3*B/c^5/f/(tan(f*x+e)+I)^2

________________________________________________________________________________________

Rubi [A]  time = 0.18, antiderivative size = 122, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3588, 77} \[ -\frac {a^3 (A-5 i B)}{3 c^5 f (\tan (e+f x)+i)^3}+\frac {a^3 (2 B+i A)}{c^5 f (\tan (e+f x)+i)^4}+\frac {4 a^3 (A-i B)}{5 c^5 f (\tan (e+f x)+i)^5}-\frac {a^3 B}{2 c^5 f (\tan (e+f x)+i)^2} \]

Antiderivative was successfully verified.

[In]

Int[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^5,x]

[Out]

(4*a^3*(A - I*B))/(5*c^5*f*(I + Tan[e + f*x])^5) + (a^3*(I*A + 2*B))/(c^5*f*(I + Tan[e + f*x])^4) - (a^3*(A -
(5*I)*B))/(3*c^5*f*(I + Tan[e + f*x])^3) - (a^3*B)/(2*c^5*f*(I + Tan[e + f*x])^2)

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {(a+i a x)^2 (A+B x)}{(c-i c x)^6} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (-\frac {4 a^2 (A-i B)}{c^6 (i+x)^6}-\frac {4 i a^2 (A-2 i B)}{c^6 (i+x)^5}+\frac {a^2 (A-5 i B)}{c^6 (i+x)^4}+\frac {a^2 B}{c^6 (i+x)^3}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {4 a^3 (A-i B)}{5 c^5 f (i+\tan (e+f x))^5}+\frac {a^3 (i A+2 B)}{c^5 f (i+\tan (e+f x))^4}-\frac {a^3 (A-5 i B)}{3 c^5 f (i+\tan (e+f x))^3}-\frac {a^3 B}{2 c^5 f (i+\tan (e+f x))^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 4.50, size = 91, normalized size = 0.75 \[ \frac {a^3 (\cos (8 e+11 f x)+i \sin (8 e+11 f x)) (-4 (A+4 i B) \sin (2 (e+f x))+4 (B-4 i A) \cos (2 (e+f x))-15 i A)}{240 c^5 f (\cos (f x)+i \sin (f x))^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^5,x]

[Out]

(a^3*((-15*I)*A + 4*((-4*I)*A + B)*Cos[2*(e + f*x)] - 4*(A + (4*I)*B)*Sin[2*(e + f*x)])*(Cos[8*e + 11*f*x] + I
*Sin[8*e + 11*f*x]))/(240*c^5*f*(Cos[f*x] + I*Sin[f*x])^3)

________________________________________________________________________________________

fricas [A]  time = 0.85, size = 64, normalized size = 0.52 \[ \frac {{\left (-6 i \, A - 6 \, B\right )} a^{3} e^{\left (10 i \, f x + 10 i \, e\right )} - 15 i \, A a^{3} e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (-10 i \, A + 10 \, B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )}}{240 \, c^{5} f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x, algorithm="fricas")

[Out]

1/240*((-6*I*A - 6*B)*a^3*e^(10*I*f*x + 10*I*e) - 15*I*A*a^3*e^(8*I*f*x + 8*I*e) + (-10*I*A + 10*B)*a^3*e^(6*I
*f*x + 6*I*e))/(c^5*f)

________________________________________________________________________________________

giac [B]  time = 6.87, size = 309, normalized size = 2.53 \[ -\frac {2 \, {\left (15 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 30 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} - 15 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} - 140 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 10 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 170 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 65 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 282 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 12 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 170 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 65 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 140 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 10 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 30 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 15 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 15 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{15 \, c^{5} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{10}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x, algorithm="giac")

[Out]

-2/15*(15*A*a^3*tan(1/2*f*x + 1/2*e)^9 + 30*I*A*a^3*tan(1/2*f*x + 1/2*e)^8 - 15*B*a^3*tan(1/2*f*x + 1/2*e)^8 -
 140*A*a^3*tan(1/2*f*x + 1/2*e)^7 + 10*I*B*a^3*tan(1/2*f*x + 1/2*e)^7 - 170*I*A*a^3*tan(1/2*f*x + 1/2*e)^6 + 6
5*B*a^3*tan(1/2*f*x + 1/2*e)^6 + 282*A*a^3*tan(1/2*f*x + 1/2*e)^5 - 12*I*B*a^3*tan(1/2*f*x + 1/2*e)^5 + 170*I*
A*a^3*tan(1/2*f*x + 1/2*e)^4 - 65*B*a^3*tan(1/2*f*x + 1/2*e)^4 - 140*A*a^3*tan(1/2*f*x + 1/2*e)^3 + 10*I*B*a^3
*tan(1/2*f*x + 1/2*e)^3 - 30*I*A*a^3*tan(1/2*f*x + 1/2*e)^2 + 15*B*a^3*tan(1/2*f*x + 1/2*e)^2 + 15*A*a^3*tan(1
/2*f*x + 1/2*e))/(c^5*f*(tan(1/2*f*x + 1/2*e) + I)^10)

________________________________________________________________________________________

maple [A]  time = 0.25, size = 87, normalized size = 0.71 \[ \frac {a^{3} \left (-\frac {B}{2 \left (\tan \left (f x +e \right )+i\right )^{2}}-\frac {-4 i A -8 B}{4 \left (\tan \left (f x +e \right )+i\right )^{4}}-\frac {-5 i B +A}{3 \left (\tan \left (f x +e \right )+i\right )^{3}}-\frac {4 i B -4 A}{5 \left (\tan \left (f x +e \right )+i\right )^{5}}\right )}{f \,c^{5}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x)

[Out]

1/f*a^3/c^5*(-1/2*B/(tan(f*x+e)+I)^2-1/4*(-4*I*A-8*B)/(tan(f*x+e)+I)^4-1/3*(A-5*I*B)/(tan(f*x+e)+I)^3-1/5*(4*I
*B-4*A)/(tan(f*x+e)+I)^5)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 9.01, size = 128, normalized size = 1.05 \[ \frac {\frac {a^3\,\left (4\,A+B\,1{}\mathrm {i}\right )}{30}+\frac {a^3\,\mathrm {tan}\left (e+f\,x\right )\,\left (5\,B+A\,10{}\mathrm {i}\right )}{30}-\frac {B\,a^3\,{\mathrm {tan}\left (e+f\,x\right )}^3}{2}-\frac {a^3\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (10\,A-B\,5{}\mathrm {i}\right )}{30}}{c^5\,f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^5+{\mathrm {tan}\left (e+f\,x\right )}^4\,5{}\mathrm {i}-10\,{\mathrm {tan}\left (e+f\,x\right )}^3-{\mathrm {tan}\left (e+f\,x\right )}^2\,10{}\mathrm {i}+5\,\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3)/(c - c*tan(e + f*x)*1i)^5,x)

[Out]

((a^3*(4*A + B*1i))/30 + (a^3*tan(e + f*x)*(A*10i + 5*B))/30 - (B*a^3*tan(e + f*x)^3)/2 - (a^3*tan(e + f*x)^2*
(10*A - B*5i))/30)/(c^5*f*(5*tan(e + f*x) - tan(e + f*x)^2*10i - 10*tan(e + f*x)^3 + tan(e + f*x)^4*5i + tan(e
 + f*x)^5 + 1i))

________________________________________________________________________________________

sympy [A]  time = 1.12, size = 219, normalized size = 1.80 \[ \begin {cases} - \frac {960 i A a^{3} c^{10} f^{2} e^{8 i e} e^{8 i f x} + \left (640 i A a^{3} c^{10} f^{2} e^{6 i e} - 640 B a^{3} c^{10} f^{2} e^{6 i e}\right ) e^{6 i f x} + \left (384 i A a^{3} c^{10} f^{2} e^{10 i e} + 384 B a^{3} c^{10} f^{2} e^{10 i e}\right ) e^{10 i f x}}{15360 c^{15} f^{3}} & \text {for}\: 15360 c^{15} f^{3} \neq 0 \\\frac {x \left (A a^{3} e^{10 i e} + 2 A a^{3} e^{8 i e} + A a^{3} e^{6 i e} - i B a^{3} e^{10 i e} + i B a^{3} e^{6 i e}\right )}{4 c^{5}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**5,x)

[Out]

Piecewise((-(960*I*A*a**3*c**10*f**2*exp(8*I*e)*exp(8*I*f*x) + (640*I*A*a**3*c**10*f**2*exp(6*I*e) - 640*B*a**
3*c**10*f**2*exp(6*I*e))*exp(6*I*f*x) + (384*I*A*a**3*c**10*f**2*exp(10*I*e) + 384*B*a**3*c**10*f**2*exp(10*I*
e))*exp(10*I*f*x))/(15360*c**15*f**3), Ne(15360*c**15*f**3, 0)), (x*(A*a**3*exp(10*I*e) + 2*A*a**3*exp(8*I*e)
+ A*a**3*exp(6*I*e) - I*B*a**3*exp(10*I*e) + I*B*a**3*exp(6*I*e))/(4*c**5), True))

________________________________________________________________________________________